public class code5_3 {
    //每次最多爬 m 阶
    public int climbStairsM(int n,int m) {
        int[] dp = new int[n+1];
        dp[0] = 1;//什么都不做也是一种方案
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= m; j++) {
                if(i-j>=0) {
                    dp[i] += dp[i-j];
                }
            }
        }
        return dp[n];
    }
}
